import { getToken } from '@/utils/auth'
import request from '@/utils/request'

export function getReport(data) { // 查询报告数据
  return request({
    url: '/product/reportschedule/getReport',
    method: 'post',
    data
  })
}

export function Throughreport() { // 查找审批人
  var url = '/product/reportschedule/Throughreport'
  return request({
    url: url,
    method: 'get'
  })
}

export function SubmitReport(data) { // 提交产品报告
  var url = '/product/product/SubmitReport'
  return request({
    url: url,
    method: 'post',
    data: {
      products: data,
      requestID: getToken().substring(1)
    }
  })
}
export function saveReport(param) { // 通过报告
  return request({
    url: '/product/reportschedule/saveReport',
    method: 'post',
    params: {
      beforeReportSchedule: parseInt(param.id), // 报告序列号
      reportID: parseInt(param.reportID), // 报告号
      reportPeople: parseInt(param.reportPeople) // 下一个审批人ID
    }
  })
}

export function query(data) { // 查询数据
  return request({
    url: '/product/reportschedule/query',
    method: 'post',
    data
  })
}

export function rejected(data) { // 查询数据
  return request({
    url: '/product/reportschedule/rejected',
    method: 'post',
    data
  })
}
